package cn.anlucky.apiadmin.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 
 * @TableName apiinfo
 */
@TableName(value ="apiinfo")
@Data
public class Apiinfo implements Serializable {
    /**
     * ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * api title
     */
    @TableField(value = "title")
    private String title;

    /**
     * url
     */
    @TableField(value = "url")
    private String url;

    /**
     * api description 介绍
     */
    @TableField(value = "description")
    private String description;

    /**
     * response 格式
     */
    @TableField(value = "response_formart")
    private String responseFormart;

    /**
     * post / get
     */
    @TableField(value = "method")
    private String method;

    /**
     * JSON 提交还是参数提交
     */
    @TableField(value = "request_body_type")
    private String requestBodyType;

    /**
     * request header
     */
    @TableField(value = "request_heads")
    private String requestHeads;

    /**
     * request body
     */
    @TableField(value = "request_params")
    private String requestParams;

    /**
     * response demo
     */
    @TableField(value = "response_demo")
    private String responseDemo;

    /**
     * 1 enabled 0 disabled
     */
    @TableField(value = "enabled")
    private String enabled;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Apiinfo other = (Apiinfo) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
            && (this.getUrl() == null ? other.getUrl() == null : this.getUrl().equals(other.getUrl()))
            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
            && (this.getResponseFormart() == null ? other.getResponseFormart() == null : this.getResponseFormart().equals(other.getResponseFormart()))
            && (this.getMethod() == null ? other.getMethod() == null : this.getMethod().equals(other.getMethod()))
            && (this.getRequestBodyType() == null ? other.getRequestBodyType() == null : this.getRequestBodyType().equals(other.getRequestBodyType()))
            && (this.getRequestHeads() == null ? other.getRequestHeads() == null : this.getRequestHeads().equals(other.getRequestHeads()))
            && (this.getRequestParams() == null ? other.getRequestParams() == null : this.getRequestParams().equals(other.getRequestParams()))
            && (this.getResponseDemo() == null ? other.getResponseDemo() == null : this.getResponseDemo().equals(other.getResponseDemo()))
            && (this.getEnabled() == null ? other.getEnabled() == null : this.getEnabled().equals(other.getEnabled()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
        result = prime * result + ((getUrl() == null) ? 0 : getUrl().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        result = prime * result + ((getResponseFormart() == null) ? 0 : getResponseFormart().hashCode());
        result = prime * result + ((getMethod() == null) ? 0 : getMethod().hashCode());
        result = prime * result + ((getRequestBodyType() == null) ? 0 : getRequestBodyType().hashCode());
        result = prime * result + ((getRequestHeads() == null) ? 0 : getRequestHeads().hashCode());
        result = prime * result + ((getRequestParams() == null) ? 0 : getRequestParams().hashCode());
        result = prime * result + ((getResponseDemo() == null) ? 0 : getResponseDemo().hashCode());
        result = prime * result + ((getEnabled() == null) ? 0 : getEnabled().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", title=").append(title);
        sb.append(", url=").append(url);
        sb.append(", description=").append(description);
        sb.append(", responseFormart=").append(responseFormart);
        sb.append(", method=").append(method);
        sb.append(", requestBodyType=").append(requestBodyType);
        sb.append(", requestHeads=").append(requestHeads);
        sb.append(", requestParams=").append(requestParams);
        sb.append(", responseDemo=").append(responseDemo);
        sb.append(", enabled=").append(enabled);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}